package com.blog.cloud.sms.dynamic;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.LinkedHashMap;
import java.util.Map;

@Getter
@Setter
@Component
@ConfigurationProperties(prefix = DynamicSmsProperties.PREFIX)
public class DynamicSmsProperties {
    // 参考 DynamicDataSourceProperties
    public static final String PREFIX = "spring.sms.dynamic";

    /**
     * 必须设置默认的源,默认master
     */
    private String primary = "master";

    /**
     * 是否启用严格模式,默认不启动. 严格模式下未匹配到短信源直接报错, 非严格模式下则使用默认短信源primary所设置的短信源
     */
    private Boolean strict = false;

    /**
     * 是否懒加载短信源
      */
    private Boolean lazy = false;

    /**
     * 每一个短信源
     */
    private Map<String, SmsSourceProperty> source = new LinkedHashMap<>();

}
